/*
 * "Copyright (c) 2012 Universitat Pompeu Fabra.
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 *
 * IN NO EVENT SHALL UNIVERSITAT POMPEU FABRA BE LIABLE TO ANY PARTY 
 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING 
 * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF POMPEU FABRA
 * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * UNIVERSITAT POMPEU FABRA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND UNIVERSITAT POMPEU FABRA HAS NO OBLIGATION TO 
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 */

#ifndef __HbcpPARAMETERS_H__
#define __HbcpPARAMETERS_H__

#include <AM.h>

#define DATA_LENGTH 90
#define DEFAULT_MAX_AGGREGATION 4

//Routing
#define DEFAULT_MAX_HOPS 10

#define DEFAULT_DISCOVERY_SLOT_TIME 500
#define DEFAULT_COLLECTION_SLOT_TIME 2000

#define BASE_RETRY_TIME 10
#define SPREAD_RETRY_TIME 30
#define MAX_RETRIES 32

#define CC2420THROUGHPUT 30
#define HBTP_RETRIES 7

#define MAX_POWER 31

#define SECTOR_DISTANCE 3

/* 
 * The number of times the ForwardingEngine will try to 
 * transmit a packet before giving up if the link layer
 * supports acknowledgments. If the link layer does
 * not support acknowledgments it sends the packet once.
 */ 

enum {
	#if PLATFORM_MICAZ || PLATFORM_TELOSA || PLATFORM_TELOSB || PLATFORM_TMOTE || PLATFORM_INTELMOTE2 || PLATFORM_SHIMMER || PLATFORM_IRIS 
	DEFAULT_RETRY_DELAY = 100,
	DEFAULT_RETRIES = 30,
	#else
	DEFAULT_RETRY_DELAY = 100,
	DEFAULT_RETRIES = 7,
	#endif
};

/*NETWORK*/ 
uint8_t MAX_AGGREGATION = DEFAULT_MAX_AGGREGATION;
uint8_t MAX_HOPS = DEFAULT_MAX_HOPS;

/*ROUTING*/
uint16_t DISCOVERY_SLOT_TIME = DEFAULT_DISCOVERY_SLOT_TIME;
uint16_t COLLECTION_SLOT_TIME = DEFAULT_COLLECTION_SLOT_TIME;

/*LINK*/ 

uint8_t HbcpRetries = DEFAULT_RETRIES;
uint16_t HbcpRetryDelay = DEFAULT_RETRY_DELAY;
uint8_t TX_POWER = MAX_POWER;

#endif
